<%@ page session="false"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/my.tld" prefix="my" %>
<%@ taglib uri="/WEB-INF/tld/user.tld" prefix="user" %>
<%@ taglib uri="/WEB-INF/tld/activity.tld" prefix="activity" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<span id="_selfLogin">
<script>
$(document).ready(function () {
    jQuery("#registeForm").validationEngine();
    $('#_rsubmit').bind('click', function () {
        if ($('#registeForm').validationEngine('validate')) {
        $(this).attr('disabled', 'disabled');
        alert('注册');
        }
    });
});
</script>
<c:set var="cuser" value="${user:user(userId)}" />
	    <c:if test="${empty cuser}">	
	     <form id="userLoginform" action="./portal.do?do=Portal.loginPost" method="post">			 
             <div class="login bor min_login">               
                	<h3 class="log_h3">经常登录的同志才是好同志~~~</h3>
                    <h4 class="log_h4"><label>账　号</label><input type="text"  name="username" id="username"></h4>
                    <h4 class="log_h4"><label>密　码</label><input  name="password" id="password" type="text" ></h4>
                    <h4 class="log_h4"><label>验证码</label><input type="text" size="5" name="vcode"  class="y" style="width:80px;">
					<c:set var="vkey" value="${my:vcode_key()}"/>
					<img src="${root}vcode?vkey=${vkey}" alt="." /></h4>
					 <input type="hidden" name="vkey" value="${vkey}"/>
                     <input type="hidden" name="go" value="login"/>
                    <h5 class="log_h5">
                    <!-- <input name="" type="checkbox" value="" /><label>下次自动登录</label> --><label><a>${msg}</a></label></h5>
                    <p class="log_p"><input type="button" id="_login" value="登　录" class="reg_btn" /><label>&nbsp;<a  target="_blank" href="${root}user.do${p1}&amp;do=User.findPassword">忘记密码? </a></label></p>
                    <ul>
                    	<li><a href="./user.do?src=10201&do=Reg.aa" target="_blank">新用户注册</a></li>
                    	<li>每日前1000名注册用户赠送邮件提醒服务！</li>  
                    </ul>                   
                </div>
               </form> 
       </c:if>
	   <c:if test="${not empty cuser}">				
				<div class="logout bor">
                	<h3><ins><a href="#">空间</a><em>|</em><a href="./portal.do?do=Portal.logout&go=portal.do?do=Portal.layout">退出</a></ins>欢迎<span class="f14">${my:txt(cuser.nickname)}</span></h3>
                    <h4><img alt="" src="images/pr.jpg"></h4>
                    <p>居委会实习生</p>
                    <p><img alt="" src="images/ic_01.jpg"><label>12天</label>&nbsp;&nbsp;<img alt="" src="images/ic_02.jpg"><label>31天</label></p>
                    <ul>
                    	<li><a target="_blank" href="./user.do?src=10201&do=User.basic">个人安全设置</a></li>
                    	<li><a target="_blank" href="./user.do?src=10201&do=Subscript.layout">设置关注信息</a></li>  
                    </ul>               
                </div>
       </c:if>
       <script>
$(document).ready(function () {
	$('#_login').bind('click',function(){
 		$.ajax({
			   type: "POST",
			   url: "./portal.do?do=Portal.loginPost",
			   data: $('#userLoginform').serialize(),
			   success: function(msg){
			     $('#_selfLogin').html(msg);                  
			   },
			  statusCode: {
			    404: function() {
			      alert('page not found');
			    }
			  }
			});
	});

});
</script>
</span>